home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 5.1 KB | 132 lines | [TEXT/GEOL] |
- Item 8379014 19-July-89 07:40
-
- From: MUYSVASOVIC1 ER&D - J-D Muys-Vasovic
-
- To: APPLE.BUGS Apple Bugs Reporting
- MACAPP.TEST MacApp SQA Team
-
- cc: MUYSVASOVIC1 ER&D - J-D Muys-Vasovic
- MACAPP.TECH$ MACAPP Tech
- BURBECK.S Burbeck, Steve
- FRIEDRICH1 Friedrich, Steve
- MACDTS Macintosh Developer Technical Supt.
-
- Sub: MacApp B9 doCreateViews bug
-
- I just installed MacApp B9 (the real one), and discovered a new bug.
- The bug is in the TEvtHandler.DoCreateViews method, called from
- NewTemplateWindow.
-
- The offending lines are the following:
-
- IF (lastParent = NIL) & (lastRoot <> NIL) THEN
- IF aView <> NIL THEN
- lastParent := aView.FindSubView(itsParentID)
- ELSE
- lastParent := lastRoot.FindSubView(itsParentID);
-
- One previous version was:
-
- IF (lastParent = NIL) & (lastRoot <> NIL) THEN
- lastParent := lastRoot.FindSubView(itsParentID);
-
- They are executed when you want to find the already built parent of a new view.
- In my case, I called NewTemplateWindow for the following view resource:
-
- resource 'view' (1001, purgeable) {
- {
- root, 'WIND', { 50, 20 }, { kWindowHeight, kWindowWidth },
- sizeVariable, sizeVariable, shown, enabled,
- Window { "", zoomDocProc, noGoAwayBox, resizable, modeless,
- ignoreFirstClick, freeOnClosing, disposeOnFree, closesDocument,
- openWithDocument, dontAdaptToScreen,
- stagger, forceOnScreen, dontCenter, 'TV02', "No Document" };
-
- 'WIND', 'SCLR', { 0, kCellWidth }, { kWindowHeight-kSBarSizeMinus1,
- kWindowWidth-kSBarSizeMinus1-kCellWidth },
- sizeRelSuperView, sizeRelSuperView, shown, enabled,
- Scroller{ "", vertScrollBar, horzScrollBar, 0, 0, 16, 16,
- vertConstrain, horzConstrain, { 0, 0, 0, 0 } };
-
- 'WIND', 'TPal', { 0, 0 }, { 400, kCellWidth },
- sizeFixed, sizeFixed, shown, enabled,
- GridView{ "TPaletteView", 10, 1, kCellHeight, kCellWidth, 2, 2, AdornRows,
- AdornCols,
- singleSelection };
-
- 'SCLR', 'TV02', { 0, 0 }, { kWindowHeight,
- kWindowWidth-kSBarSizeMinus1-kCellWidth},
- sizeFixed, sizeFixed, shown, disabled,
- View { "TView5"}
- }
- };
-
- The MacApp debugger tells me the following (run with intensive debugging on):
-
- Command [ BCDEFGHILMOPπQRSßTWX?]: X
- Toggle Flag [abcefimprsUxD?]: I
- Intense debugging: TRUE
- Command [ BCDEFGHILMOPπQRSßTWX?]: G
- go…
- signature = 'wind'
- itsParentID = ' ', thisViewID = 'WIND'
- itsLocation = (20, 50), itsSize = (430, 280)itsHSizeDet = 4, itsVSizeDet =
- 4
- , isEnabled = TRUE
- ---------- end of view ----------
- signature = 'scrl'
- itsParentID = 'WIND', thisViewID = 'SCLR'
- itsLocation = (32, 0), itsSize = (383, 265)itsHSizeDet = 1, itsVSizeDet = 1
- , isEnabled = TRUE
- ---------- end of view ----------
- signature = 'sbar'
- itsParentID = ' ', thisViewID = ' '
- itsLocation = (0, 0), itsSize = (0, 0)itsHSizeDet = 4, itsVSizeDet = 4
- , isEnabled = TRUE
- ---------- end of view ----------
- signature = 'sbar'
- itsParentID = ' ', thisViewID = ' '
- itsLocation = (0, 0), itsSize = (0, 0)itsHSizeDet = 4, itsVSizeDet = 4
- , isEnabled = TRUE
- ---------- end of view ----------
- signature = 'grid'
- itsParentID = 'WIND', thisViewID = 'TPal'
- itsLocation = (0, 0), itsSize = (32, 400)itsHSizeDet = 5, itsVSizeDet = 5
- , isEnabled = TRUE
- ---------- end of view ----------
- signature = 'view'
- itsParentID = 'SCLR', thisViewID = 'TV02'
- itsLocation = (0, 0), itsSize = (383, 280)itsHSizeDet = 5, itsVSizeDet = 5
- , isEnabled = FALSE
- ---------- end of view ----------
- Unable to find subview: 'SCLR'
- ProgramBreak: !
- stopped at Break TVIEW.FINDSUBVIEW Seg#: 24 Self: $002B04D8 is TPALETTEVIEW
- Command [ BCDEFGHILMOPπQRSßTWX?]: G
- go…
- ProgramBreak: Unable to find parent view for template
- stopped at Break TEVTHANDLER.DOCREATEVIEWS Seg#: 12 Self: $002B069C is
- TVIEW5APPLICATION
- Command [ BCDEFGHILMOPπQRSßTWX?]: Q
- Exit to shell. Are you sure [NY?]: Y
-
-
-
- As you can see, the window is first correctly created, then the scroller and
- its two scroll bars, then the 'TPal' (palette) view. But the 'TV02' cannot be
- created. The reason why this happens is that aView is the 'TPal' view when the
- code gets executed, and of course, 'TPal'.FindSubView('SCLR') fails. The
- shortest version does not have this problem of course. I suppose the code was
- changed for efficiency reasons, to shorten the search of the parent view. It
- proves buggy however. Another proof of that is that if you swap the 'TPal' and
- 'TV02' descriptions in the resource, everything is OK. And the view should not
- depend on the order in which his components are described.
-
- The question is: what is the best course to correct this? My best guess is
- still to change the code back to the previous, lest efficient code. I changed
- my UMacApp.TEvtHandler.p file accordingly, but it's clearly only a temporary
- fix.
-
- Jean-Denis.
-
-